capture drop sample
gen sample=(S_pds==1 & n_ud==1) 

eststo clear
eststo: reghdfe ln_q_sbjo   S_sourcing  ln_q_bt_all  ///
if sample==1, ///
abs(gr_sjt top_dest_b) vce (cluster gr_sjt)
  quietly estadd local CTRL ="No", replace  
  quietly estadd local est ="OLS", replace  
  quietly estadd local FE ="sjy,d", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  . , replace     

eststo: reghdfe ln_av_q_ship_sbjo   S_sourcing  ln_q_bt_all  ///
if sample==1, ///
abs(gr_sjt top_dest_b) vce (cluster gr_sjt)
  quietly estadd local CTRL ="No", replace  
  quietly estadd local est ="OLS", replace  
  quietly estadd local FE ="sjy,d", replace  
  quietly estadd local CTRL2 ="Yes", replace  
  quietly estadd scalar  U =  . , replace     

eststo: reghdfe ln_num_l_o   S_sourcing  ln_q_bt_all  ///
if sample==1, ///
abs(gr_sjt top_dest_b) vce (cluster gr_sjt)
  quietly estadd local CTRL ="No", replace  
  quietly estadd local est ="OLS", replace  
  quietly estadd local FE ="sjy,d", replace  
  quietly estadd local CTRL2 ="Yes", replace    
  quietly estadd scalar  U =  . , replace     
  
eststo: reghdfe ln_num_l_o   S_sourcing  ln_q_bt_all  ln_q_sbjo  ///
if sample==1, ///
abs(gr_sjt top_dest_b) vce (cluster gr_sjt)
  quietly estadd local CTRL ="Yes", replace 
  quietly estadd local est ="IV", replace 
  quietly estadd local FE ="sjy,d", replace  
  quietly estadd local CTRL2 ="Yes", replace  
  quietly estadd scalar  U =  e(rkf) , replace      

esttab using "${tables}\TableC2PanelB.tex", ///
  label replace booktabs b(3) se(3) noconstant obslast substitute(\_ _) ///
  drop(ln_q_bt_all  ln_q_sbjo) order( ) /// 
  stats(FE r2   N   , fmt( %~#s 2 %12.0fc  )  ///
  labels("FEs" `"\(R^{2}\)"'  "Obs."  ))   ///
  star(* 0.10 ** 0.05 *** 0.01) ///
  nonotes  	